import 'dart:core';

List<int> getDatesForThisWeek() {
  DateTime now = DateTime.now();
  int dayOfWeek = now.weekday; // 周日是1, 周一是2, ... 周六是7
  int daysToSubtract = dayOfWeek - 1; // 从周一开始计算
  DateTime start = now.subtract(Duration(days: daysToSubtract));
  return List.generate(7, (index) => start.add(Duration(days: index)).day,
      growable: false);
}

List<int> getDatesForThisMonthdays() {
  final now = DateTime.now();
  final currentDate = DateTime(now.year, now.month, 1);
  final nextMonth = DateTime(now.year, now.month + 1, 1);
  int daysInCurrentMonth = nextMonth.difference(currentDate).inDays;
  return List.generate(daysInCurrentMonth, (index) => index + 1,
      growable: false);
}
